package cn.sc.allinpay.allfavour.business.distdetail;

import android.os.Bundle;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;

import butterknife.BindView;
import butterknife.OnClick;
import cn.sc.allinpay.allfavour.R;
import cn.sc.allinpay.allfavour.base.activity.BaseActivity;


/**
 * activity 发券详情
 * author：pany
 * on 2017/12/1 11:14
 */
public class DistDetailActivity extends BaseActivity<DistDetailContract.View, DistDetailContract.Presenter>
        implements DistDetailContract.View {

    @BindView(R.id.tvName)
    AppCompatTextView tvName;
    @BindView(R.id.tvType)
    AppCompatTextView tvType;
    @BindView(R.id.tvPriceAmt)
    AppCompatTextView tvPriceAmt;
    @BindView(R.id.tvInventory)
    AppCompatTextView tvInventory;
    @BindView(R.id.tvValidDate)
    AppCompatTextView tvValidDate;
    @BindView(R.id.tvExplain)
    AppCompatTextView tvExplain;
    @BindView(R.id.tvNumTitle)
    AppCompatTextView tvNumTitle;//数量名称
    @BindView(R.id.tvNumer)
    AppCompatTextView tvNumer;//数量

    @Override
    protected int layoutId() {
        return R.layout.activity_dist_detail;
    }

    @Override
    protected void layoutTitle(View top, AppCompatTextView left, AppCompatTextView title, AppCompatTextView right) {
        title.setText("发券");
    }

    @Override
    protected DistDetailContract.Presenter bindPresenter() {
        return new DistDetailPresenter();
    }

    @Override
    protected void layoutContent(Bundle savedInstanceState) {

    }

    @Override
    public void showName(String data) {
        tvName.setText(data);
    }

    @Override
    public void showType(String data) {
        tvType.setText(data);
    }

    @Override
    public void showPriceAmt(String data) {
        tvPriceAmt.setText(data);
    }

    @Override
    public void showInventory(String data) {
        tvInventory.setText(data);
    }

    @Override
    public void showValidDate(String data) {
        tvValidDate.setText(data);
    }

    @Override
    public void showExplain(String data) {
        tvExplain.setText(data);
    }

    @Override
    public void showNumTitle(String data) {
        tvNumTitle.setText(data);
    }

    @Override
    public void showNumber(String data) {
        tvNumer.setText(data);
    }

    @OnClick({R.id.btnReduce, R.id.btnAddit, R.id.btnSend})
    public void btnClick(View view) {
        switch (view.getId()) {
            case R.id.btnReduce:
                presenter.reduceNumber();
                break;
            case R.id.btnAddit:
                presenter.additNumber();
                break;
            case R.id.btnSend:
                presenter.reqDistCoupon();
                break;
        }

    }
}
